package branch;

public class Iftest1 {
    public static void main(String[] args) {
    //智能行驶：遇到不同红绿灯的判断
        iftest();
    }
    public static void iftest(){
        boolean red = true;
        boolean green = false;
        boolean yellow = false;
        if(red){
            System.out.println("红灯，停止");
        }
         else if(green){
            System.out.println("绿灯，前进");
        }
         else if(yellow){
            System.out.println("黄灯，减速");
        }
         else {
            System.out.println("无法识别");
        }
    }
}
